﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EntGuayasSLA.BL;
using EntGuayasSLA.BL.Archivos.Pdf;
using EntGuayasSLA.BL.Listas;
using EntGuayasSLA.BL.Listas.Criterias;
using Ext.Net;

namespace EGuayas.Web.Licenciamiento.promotor
{
    public partial class pgInicial : pgBase
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
            if (!X.IsAjaxRequest)
            {
                string idPromotor = Request["idx1"];
                SetSessionPage pgSession = new SetSessionPage(SessionPage.PageUserNot, Valores.PageEvento_Lectura);
                this.hddIdPageSession.SetValue(SessionPage.PageUserNot);
                X.Js.Call("pgFn.ShowViewDetailPanel", idPromotor);
            }
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }
        [DirectMethod(ShowMask = true)]
        public Boolean DeleteSession()
        {
            try{
                Session.Clear();
                Session.Abandon();
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
            return (true);
        }
        protected void btnNotificar_Click(object sender, DirectEventArgs e)
        {
            try
            {

                Usuarios user = Usuarios.GetEditableRoot(GetSessionUsuario.UsuarioId);
                user.Estado = Valores.Codigo_Estado_Notificado;
                user.Save();
                btnNotificar.Disable();
                X.Msg.Show(new MessageBoxConfig
                {
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.INFO,
                    Title = "Información",
                    Message = string.Format("{0}", "Archivos Modificados")
                });
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }

        }
    
    }
}